]> dgit.raspbian.org Git - gnome-shell.git/log
gnome-shell.git
3 years agost/scroll-view: Use ClutterEvent getter methods
Carlos Garnacho [Fri, 4 Aug 2023 12:23:38 +0000 (14:23 +0200)]
st/scroll-view: Use ClutterEvent getter methods

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2860>

3 years agost/scroll-bar: Use ClutterEvent getter methods
Carlos Garnacho [Fri, 4 Aug 2023 12:23:09 +0000 (14:23 +0200)]
st/scroll-bar: Use ClutterEvent getter methods

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2860>

3 years agost/entry: Use ClutterEvent getter methods
Carlos Garnacho [Fri, 4 Aug 2023 12:22:43 +0000 (14:22 +0200)]
st/entry: Use ClutterEvent getter methods

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2860>

3 years agost/button: Use ClutterEvent getter methods
Carlos Garnacho [Fri, 4 Aug 2023 12:22:17 +0000 (14:22 +0200)]
st/button: Use ClutterEvent getter methods

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2860>

3 years agoinjectionManager: Support overriding vfuncs
Florian Müllner [Sat, 22 Jul 2023 16:44:08 +0000 (18:44 +0200)]
injectionManager: Support overriding vfuncs

Overriding vfuncs can be useful, in particular when we convert
to ES modules, and exported symbols cannot easily be swapped out.

Adapt overrideMethod() to work correctly in that case as well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2809>

3 years agoextensionUtils: Add InjectionManager
Florian Müllner [Fri, 23 Jun 2023 17:53:05 +0000 (19:53 +0200)]
extensionUtils: Add InjectionManager

It is fairly common for extensions to monkey-patch existing
classes. Add a small helper class that makes this a tad bit
more convenient.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2809>

3 years agostatus/backlight: Notify slider value changes
Florian Müllner [Wed, 2 Aug 2023 16:09:46 +0000 (18:09 +0200)]
status/backlight: Notify slider value changes

The custom setter used by the slider item isn't emitting change
notifications, so the property binding that uses it as source
never propagates the new value.

Fix this by emitting proper change notifications.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2856>

3 years agoUpdate Portuguese translation
Hugo Carvalho [Fri, 4 Aug 2023 15:49:07 +0000 (15:49 +0000)]
Update Portuguese translation

3 years agoUpdate Russian translation
Artur So [Thu, 3 Aug 2023 16:00:17 +0000 (16:00 +0000)]
Update Russian translation

3 years agoUpdate Chinese (China) translation
Boyuan Yang [Wed, 2 Aug 2023 20:12:54 +0000 (20:12 +0000)]
Update Chinese (China) translation

3 years agoUpdate Chinese (China) translation
Boyuan Yang [Wed, 2 Aug 2023 20:10:51 +0000 (20:10 +0000)]
Update Chinese (China) translation

3 years agostyle: Fix colored indicators lacking style in the overview
Sam Hewitt [Mon, 31 Jul 2023 13:31:40 +0000 (11:01 -0230)]
style: Fix colored indicators lacking style in the overview

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agostyle: Remove important override on button insensitive style
Sam Hewitt [Wed, 19 Jul 2023 13:01:09 +0000 (10:31 -0230)]
style: Remove important override on button insensitive style

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agostyle: Fix mismatched border radius on notifications
Sam Hewitt [Tue, 18 Jul 2023 13:31:02 +0000 (11:01 -0230)]
style: Fix mismatched border radius on notifications

- fixes #6801

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agostyle: Fix border on quick settings button
Sam Hewitt [Tue, 18 Jul 2023 13:10:44 +0000 (10:40 -0230)]
style: Fix border on quick settings button

- fixes #6832

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agostyle: Change lg border radius so it doesn't look cut off in Overview
Sam Hewitt [Tue, 18 Jul 2023 13:04:05 +0000 (10:34 -0230)]
style: Change lg border radius so it doesn't look cut off in Overview

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agostyle: Fix osd elements not being dark in light theme
Sam Hewitt [Tue, 18 Jul 2023 13:00:50 +0000 (10:30 -0230)]
style: Fix osd elements not being dark in light theme

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agostyle: Fix focus border color on system entries
Sam Hewitt [Wed, 5 Jul 2023 16:47:57 +0000 (14:17 -0230)]
style: Fix focus border color on system entries

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agostyle: Fix incorrect light scheme color issues in app folder and screenshot ui
Sam Hewitt [Wed, 5 Jul 2023 16:43:39 +0000 (14:13 -0230)]
style: Fix incorrect light scheme color issues in app folder and screenshot ui

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agopanel: Fix drawing functions for light theme
Sam Hewitt [Wed, 5 Jul 2023 15:00:14 +0000 (12:30 -0230)]
panel: Fix drawing functions for light theme

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2823>

3 years agoBump mutter image
Florian Müllner [Wed, 2 Aug 2023 12:20:22 +0000 (14:20 +0200)]
Bump mutter image

Pull in tecla and pipewire fixes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2855>

3 years agopopupMenu: Hide ornament by default
Florian Müllner [Thu, 13 Jul 2023 17:04:20 +0000 (19:04 +0200)]
popupMenu: Hide ornament by default

We have always defaults to an empty ornament, so that menu items
are always aligned, even when radio items are used.

However radio items are fairly rare, so most of the time we end
up with an extra margin with no purpose. The design team now
prefers radio items to only align with each other, so that regular
items get the expected margin.

Change the defaults accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>

3 years agopopupMenu: Never add ornament padding to image items
Florian Müllner [Tue, 1 Aug 2023 16:13:10 +0000 (19:13 +0300)]
popupMenu: Never add ornament padding to image items

PopupImageMenuItem moves the ornament after the label, so we don't
need the additional padding that accounts for visible ornaments
for regular items.

Spotted by Sebastian Keller.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>

3 years agopopupMenu: Use correct padding for items with hidden ornaments
Sebastian Keller [Wed, 17 May 2023 20:49:34 +0000 (22:49 +0200)]
popupMenu: Use correct padding for items with hidden ornaments

This also restores the padding adjustments that were erroneously removed
in a0fde0ee, but now they only apply to ornamented items.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>

3 years agostatus/network: Only show ornament in radio-mode
Florian Müllner [Thu, 13 Jul 2023 17:03:08 +0000 (19:03 +0200)]
status/network: Only show ornament in radio-mode

Soon only radio items should use a visible ornament, to avoid
unnecessary extra margins in regular items.

Network items can act as both radio- and regular items, so
update the ornament accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>

3 years agostatus/keyboard: Explicitly initialize ornament
Florian Müllner [Thu, 13 Jul 2023 16:50:30 +0000 (18:50 +0200)]
status/keyboard: Explicitly initialize ornament

Layout items use the ornament to indicate the active layout, so
their ornament should always be NONE or DOT.

The default is about to change to HIDDEN, so explicitly initialize
the ornament to NONE to keep the current radio item appearance.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>

3 years agostyle: Stop overriding ornament
Florian Müllner [Thu, 13 Jul 2023 17:09:05 +0000 (19:09 +0200)]
style: Stop overriding ornament

Hiding elements that are supposed to be visible from the stylesheet
is confusing, don't do that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>

3 years agopanel: Use privacy_indicator_color
robert.mader@collabora.com [Sat, 29 Jul 2023 13:58:39 +0000 (16:58 +0300)]
panel: Use privacy_indicator_color

For privacy indicators and screen sharing. For the later also remove
the transparentize so it becomes more similar to the screen recording
indicator.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2852>

3 years agoUpdate Hebrew translation
Yosef Or Boczko [Mon, 31 Jul 2023 06:34:34 +0000 (06:34 +0000)]
Update Hebrew translation

3 years agoUpdate Georgian translation
Ekaterine Papava [Mon, 31 Jul 2023 03:56:05 +0000 (03:56 +0000)]
Update Georgian translation

3 years agoUpdate Persian translation
Danial Behzadi [Sun, 30 Jul 2023 21:57:07 +0000 (21:57 +0000)]
Update Persian translation

3 years agoUpdate Persian translation
Danial Behzadi [Sun, 30 Jul 2023 21:52:08 +0000 (21:52 +0000)]
Update Persian translation

3 years agoUpdate Hungarian translation
Balázs Úr [Sun, 30 Jul 2023 20:54:19 +0000 (20:54 +0000)]
Update Hungarian translation

3 years agoUpdate Ukrainian translation
Yuri Chornoivan [Sun, 30 Jul 2023 17:32:33 +0000 (17:32 +0000)]
Update Ukrainian translation

3 years agoshell/camera-monitor: Tweak indicator disable timeout
robert.mader@collabora.com [Sat, 29 Jul 2023 16:11:14 +0000 (19:11 +0300)]
shell/camera-monitor: Tweak indicator disable timeout

We currently consider idle nodes as in use to avoid too fast state
changes and thus flickering of the indicator icon. However, the current
idle timeout is rather long and arguably confusing for users.

Thus switch to only consider running nodes as in use, but delay
disabling of the indicator by 500ms.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2854>

3 years agostatus/backlight: Add new quick toggle
Florian Müllner [Tue, 13 Jun 2023 19:36:20 +0000 (21:36 +0200)]
status/backlight: Add new quick toggle

Settings no longer exposes a slider for the keyboard brightness,
leaving keyboard shortcuts as the only way of adjusting it.

This is good enough in most cases, because devices with keyboard
backlight usually include corresponding keys on their keyboard.

However for devices without those keys, it would be good for the
settings to be exposed somewhere again. Quick settings seems like
a more appropriate place than "proper" Settings, since it gives
quick access that doesn't require a major focus change.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6765

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2820>

3 years agoextensions: Make ExtensionPreferences more flexible
Florian Müllner [Mon, 10 Jul 2023 03:53:45 +0000 (05:53 +0200)]
extensions: Make ExtensionPreferences more flexible

Extensions must now export a class with a fillPreferencesWindow()
method in their prefs. That is less convenient for extensions
with simple preferences than the old buildPrefsWidget() hook, as
they must wrap their widget in page/group widgets.

Address this by adding a default fillPreferencesWindow() implementation
that calls a getPreferencesWidget() method and wraps it as necessary.

This is flexible enough to support different cases fairly conveniently,
from simple single-widget prefs over tweaking the window to complex
multi-page prefs:

```js
class SimplePreferences extends ExtensionPreferences {
    getPreferencesWidget() {
        return new SimplePrefsWidget();
    }
}

class TinkerPreferences extends ExtensionPreferences {
    getPreferencesWidget() {
        return new SimplePrefsWidget();
    }

    fillPreferencesWindow(window) {
        super.fillPreferencesWindow(window);

        window.set_default_size(123, 456);
    }
}

class FullPreferences extends ExtensionPreferences {
    fillPreferencesWindow(window) {
        const page1 = new GeneralPage();
        window.add(page1);

        const page2 = new FoobarPage();
        window.add(page2);
    }
}
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextensionBase: Set up translations automatically
Florian Müllner [Mon, 10 Jul 2023 03:56:34 +0000 (05:56 +0200)]
extensionBase: Set up translations automatically

If an extension provides the gettext domain in its metadata,
then we can simply set up translations from the constructor,
so do that for a bit more convenience.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextensionBase: Stop injecting extensionManager
Florian Müllner [Mon, 10 Jul 2023 04:04:07 +0000 (06:04 +0200)]
extensionBase: Stop injecting extensionManager

All extension lookups now happen through the dedicated
Extension/ExtensionPreferences classes, so the shared
code no longer has to access the extensionManager.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextensions: Add static lookupByUUID() method
Florian Müllner [Mon, 10 Jul 2023 08:33:31 +0000 (10:33 +0200)]
extensions: Add static lookupByUUID() method

This allows the Extension/Preferences classes to provide
the UUID -> extension lookup without exposing the underlying
extension manager.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextensions: Replace exported gettext functions
Florian Müllner [Sun, 16 Jul 2023 23:13:06 +0000 (01:13 +0200)]
extensions: Replace exported gettext functions

Use the new defineTranslationFunctions() method from the previous
commit to create gettext functions for the module, instead of
re-exporting from the shared module.

It is now up to extension developers to use the more effective

```js
import {Extension} from 'etensions/extension.js';
const {gettext: _} =
    Extension.defineTranslationFunctions(import.meta.url);
```

or the more convenient

```js
import {Extension, gettext} from 'extensions/extension.js';
const _ = gettext;
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextensions: Add static defineTranslationFunctions() method
Florian Müllner [Mon, 10 Jul 2023 05:06:17 +0000 (07:06 +0200)]
extensions: Add static defineTranslationFunctions() method

The method can be used to define a set of gettext functions that
call the corresponding method of an extension.

Those functions are very similar to the gettext functions we are
exporting, except that:

 - looking up the extension is delegated to the
   Extension/Preferences class
 - it is possible to avoid examining the stack
   when called with `import.meta.url`

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextensionBase: Add static lookupByURL() method
Florian Müllner [Mon, 10 Jul 2023 04:19:53 +0000 (06:19 +0200)]
extensionBase: Add static lookupByURL() method

With convenience API like getSettings() now being provided by
the ExtensionObject subclass, extensions will need to access
their entry point more often.

Having to pass a pointer through the hierarchy can be annoying,
so add a static method that allows them to look it up:

```js
    const ext = Extension.lookupByURL(import.meta.url);
    this._settings = ext.getSettings();
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextension-tool: Use Extension base class in templates
Florian Müllner [Mon, 10 Jul 2023 09:50:15 +0000 (11:50 +0200)]
extension-tool: Use Extension base class in templates

The Extension/Preferences classes are where we will focus for
future extension convenience API, so developers should be
encouraged to use them as entry points.

Adjust the existing templates to do that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextensions: Add Extension/Preferences base classes
Florian Müllner [Sat, 1 Jul 2023 00:11:37 +0000 (02:11 +0200)]
extensions: Add Extension/Preferences base classes

Extensions now must export a class that conforms to a particular
interface both for the actual extension as well as for prefs:

enable()/disable() methods for the former, fillPreferencesWindow()
for the latter.

This is quite similar to the previous method-based entry points,
but it also gives us a more structured way of providing convenience
API in form of base classes.

Do that in form of Extension and ExtensionPreferences classes on
top of a common ExtensionBase base class.

getSettings(), initTranslations() and the gettext wrappers are
now methods of the common base, while openPreferences() moves
to the Extension class.

Based on an original suggestion from Evan Welsh.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agodbusServices/extensions: Include dir and path in metadata
Florian Müllner [Sun, 16 Jul 2023 13:15:07 +0000 (15:15 +0200)]
dbusServices/extensions: Include dir and path in metadata

As we did for extensions in the previous commit, pass the path and
dir properties alongside other metadata to extensions preferences.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agoextensionSystem: Include dir and path in data passed to extension
Florian Müllner [Sun, 16 Jul 2023 12:40:08 +0000 (14:40 +0200)]
extensionSystem: Include dir and path in data passed to extension

Extensions often need to set up additional resources from their
directory, like settings, translations or image assets.

So far extensions have used getCurrentExtension() to access the
shell's internal extension object which contains path and dir
properties. That's far from ideal, first because it requires
generating a stack to figure out the current extension, and
second because the internal object also contains state that
extensions shouldn't meddle with.

Just include those properties in the metadata we pass to the
extension constructor.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>

3 years agostatus/camera: New indicator
robert.mader@collabora.com [Thu, 13 Jul 2023 21:34:30 +0000 (23:34 +0200)]
status/camera: New indicator

Add a new status indicator following the system-status-indicators
mockup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2840>

3 years agoshell: Add device monitor for cameras
robert.mader@collabora.com [Sun, 9 Jul 2023 19:14:25 +0000 (21:14 +0200)]
shell: Add device monitor for cameras

Pipewire allows us to easily track whether any cameras are in used by
checking the state of camera nodes. Add a simple camera monitor to the
shell, allowing us to show e.g. a status indicator.

Naturally the monitor is limited to apps using Pipewire for camera
access and thus subject to the same chicken-egg problem like the camera
portal - it could confuse users that apps may use the camera without
being noticed by the monitor. The hope and assumption here is that a
better shell integration might speed up adoption of the new camera APIs

Pipewire 0.3.49 is required for refcounted `pw_init()`/`pw_deinit()`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2840>

3 years agostatus/volume: Split indicator into output and input
robert.mader@collabora.com [Fri, 28 Jul 2023 13:21:23 +0000 (16:21 +0300)]
status/volume: Split indicator into output and input

Use the new privacy indicator class for the input one and move it next
to the other privacy indicators.

While on it move all privacy indicators to the front, following the
system-status-indicators mockup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2840>

3 years agostyle: Generalize sharing indicator class
robert.mader@collabora.com [Fri, 28 Jul 2023 09:12:49 +0000 (12:12 +0300)]
style: Generalize sharing indicator class

To have a shared style for various privacy related indicators.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2840>

3 years agoUpdate Vietnamese translation
Ngọc Quân Trần [Sat, 29 Jul 2023 07:53:03 +0000 (07:53 +0000)]
Update Vietnamese translation

3 years agoUpdate Persian translation
Danial Behzadi [Fri, 28 Jul 2023 22:56:02 +0000 (22:56 +0000)]
Update Persian translation

3 years agoUpdate Russian translation
Artur So [Fri, 28 Jul 2023 18:17:45 +0000 (18:17 +0000)]
Update Russian translation

3 years agoUpdate Ukrainian translation
Yuri Chornoivan [Fri, 28 Jul 2023 17:45:51 +0000 (17:45 +0000)]
Update Ukrainian translation

3 years agoUpdate Georgian translation
Ekaterine Papava [Fri, 28 Jul 2023 05:11:42 +0000 (05:11 +0000)]
Update Georgian translation

3 years agoUpdate Hungarian translation
Balázs Úr [Thu, 27 Jul 2023 23:53:26 +0000 (23:53 +0000)]
Update Hungarian translation

3 years agoci: Make meson warnings fatal
Florian Müllner [Thu, 13 Jul 2023 22:51:19 +0000 (00:51 +0200)]
ci: Make meson warnings fatal

The Config variable that was removed in the previous commit was
actually wrong (PACKAGE_VERSION vs. GETTEXT_VERSION), so the
substituation didn't work.

Meson warns about this, let's make these warnings fatal to catch
similar issues during CI.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2844>

3 years agoextensions-app: Stop setting VERSION in config
Florian Müllner [Thu, 13 Jul 2023 22:44:23 +0000 (00:44 +0200)]
extensions-app: Stop setting VERSION in config

We set it because it was referenced by (here unused) code
in ExtensionUtils. This changed in commit 4a0b0e26c70, so
stop setting it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2844>

3 years agosubprojects/gjc: Update to lastest master
Florian Müllner [Fri, 21 Jul 2023 22:05:25 +0000 (00:05 +0200)]
subprojects/gjc: Update to lastest master

Pull in more bug fixes, in particular a fix for duplicated entries
and a potential crash when pulseaudio is restarted.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6842

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2849>

3 years agoci: Bump mutter image
Florian Müllner [Wed, 19 Jul 2023 15:26:55 +0000 (17:26 +0200)]
ci: Bump mutter image

Ever since the mutter image started to set up a non-root user for
running tests, the toolbox image built on top of it has been broken.

The issue has now been addressed, so update the image to pull in
the fix.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2850>

3 years agoci: Don't install fake pkexec in toolbox image
Florian Müllner [Thu, 20 Jul 2023 22:44:18 +0000 (00:44 +0200)]
ci: Don't install fake pkexec in toolbox image

The mutter image already replaces `pkexec` with a symlink to
`sudo`, which does the same job as the `su` wrapper.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2850>

3 years agoUpdate Friulian translation
Fabio Tomat [Thu, 20 Jul 2023 21:46:45 +0000 (21:46 +0000)]
Update Friulian translation

3 years agoUpdate Belarusian translation
Vasil Pupkin [Mon, 17 Jul 2023 14:24:54 +0000 (14:24 +0000)]
Update Belarusian translation

3 years agoextensions: Unify how manager is injected into shared module
Florian Müllner [Sun, 9 Jul 2023 10:47:05 +0000 (12:47 +0200)]
extensions: Unify how manager is injected into shared module

We unified most code paths earlier, but the common code will still
import Main locally if no extension manager was injected before.

Now that the old extensionUtils was split between extension and
preferences, each of those modules can simply import the manager
from its corresponding environment, and then inject it into the
shared module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>

3 years agoextensions: Simplify openPrefs()
Florian Müllner [Mon, 10 Jul 2023 03:12:30 +0000 (05:12 +0200)]
extensions: Simplify openPrefs()

The module is now only used inside the gnome-shell process, so
we don't have to handle the case where it is used from prefs,
and we can use regular imports for shell modules.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>

3 years agoextensions: Provide separate implementations
Florian Müllner [Sat, 1 Jul 2023 00:11:37 +0000 (02:11 +0200)]
extensions: Provide separate implementations

For the time being this mostly means re-exporting functions
from the shared module. However openPrefs() is now only
available to extensions, and we stop exporting both
getCurrentExtension() and setExtensionManager() to either
extensions or prefs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>

3 years agoextensions/internals: Port to ESM
Florian Müllner [Sun, 9 Jul 2023 00:13:17 +0000 (02:13 +0200)]
extensions/internals: Port to ESM

We got rid of all uses of extension utils code in the gnome-shell
process itself, and everything that is now using it - including
extensions - is already loaded as module.

We can therefore quickly move the file to ESM, which will help
a bit with upcoming changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>

3 years agoextensionUtils: Split out extension convenience functions
Florian Müllner [Fri, 30 Jun 2023 10:57:41 +0000 (12:57 +0200)]
extensionUtils: Split out extension convenience functions

ExtensionUtils was originally used for shared functions between
the extension system and the (old) prefs-tool, but then gained
useful API meant for extensions themselves.

It's a bit weird to mix the two, so split out the extension convenience
API into a separate module.

We will soon split up the module further, and add specific "flavors"
for extensions and preferences, with the current code providing a
shared base for both.

That should explain both the new location and the odd module name. :-)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>

3 years agoextensionUtils: Use non-legacy style
Florian Müllner [Mon, 10 Jul 2023 02:43:14 +0000 (04:43 +0200)]
extensionUtils: Use non-legacy style

The file already largely conforms to the new style. Quickly fix
up the remaining issues before making any major changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>

3 years agoextensionUtils: Move isOutOfDate() into manager
Florian Müllner [Fri, 14 Jul 2023 12:39:45 +0000 (14:39 +0200)]
extensionUtils: Move isOutOfDate() into manager

It hasn't been used anywhere else since the old prefs-tool stopped
implementing its own extension loading.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>

3 years agoextensionUtils: Always use manager to find current extension
Florian Müllner [Sun, 9 Jul 2023 10:47:05 +0000 (12:47 +0200)]
extensionUtils: Always use manager to find current extension

Now that we always have an extension manager object, we can use
the same code path for use from extensions and prefs.

For that, inject the D-Bus service's extensionManager instead
of the current extension.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodbusServices/extensions: Add basic extension manager
Florian Müllner [Sun, 9 Jul 2023 10:47:05 +0000 (12:47 +0200)]
dbusServices/extensions: Add basic extension manager

ExtensionUtils' getCurrentExtension() method currently either
returns the extension that was injected with setCurrentExtension(),
or imports Main locally to access the extensionManager.

But local imports won't work anymore when we convert to ESM,
and setCurrentExtension() is only an option for prefs.

Instead of diverging the code paths even further, we'll unify
the two cases as much as possible.

As a first step, add a basic extension manager in the Extensions
D-Bus service that exposes the same lookup() API as the "real"
extension manager.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodbusServices/extensions: Save stateObj on extension
Florian Müllner [Sun, 9 Jul 2023 00:54:58 +0000 (02:54 +0200)]
dbusServices/extensions: Save stateObj on extension

We don't need it for anything for the time being, but reducing the
differences between extension object in the gnome-shell process and
in preferences still seems a good idea.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodbusServices/extensions: Don't use getCurrentExtension()
Florian Müllner [Sun, 9 Jul 2023 10:47:05 +0000 (12:47 +0200)]
dbusServices/extensions: Don't use getCurrentExtension()

The prefs dialog is created on behalf of a particular extension.
It's a bit silly to rely on getCurrentExtension() to access it,
instead of just keeping track of it ourselves.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodbusServices/extensions: Check earlier for existing dialog
Florian Müllner [Sun, 9 Jul 2023 22:00:04 +0000 (00:00 +0200)]
dbusServices/extensions: Check earlier for existing dialog

There is no point in making a D-Bus call if we are going to bail
out anyway.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agoextensionUtils: Slightly optimize current extension lookup
Florian Müllner [Sun, 9 Jul 2023 23:20:53 +0000 (01:20 +0200)]
extensionUtils: Slightly optimize current extension lookup

When looking for a directory name that matches the extension UUID,
we can just as well use GLib's dirname()/basename() functions
instead of wrapping the path in a GFile.

We also know that the original path corresponds to a regular file
and not a directory, so rearrange the loop to avoid a lookup that
is guaranteed to fail.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agoextensionUtils: Stop using RegExp for stack parsing
Florian Müllner [Sun, 9 Jul 2023 23:20:53 +0000 (01:20 +0200)]
extensionUtils: Stop using RegExp for stack parsing

We currently use a regular expression to extract the exact file path
from a stack line. That RE is no longer accurate:

 - we assume a line number at the end, but at one point the column
   number was added as well
 - stacks from ES modules use file:// URIs instead of plain paths

Luckily that doesn't matter: We don't want to access any actual
files, so all we need is a path that can be traversed and that
contains the UUID.

We can get that with simple string manipulation, so avoid the regex
overhead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodependencies: Migrate to ES module and organize dependencies
Evan Welsh [Mon, 10 Jul 2023 06:34:52 +0000 (23:34 -0700)]
dependencies: Migrate to ES module and organize dependencies

gi modules are always loaded (there is no API for "set version without
loading"), so
we need to break dependencies.js into three sections:

- Required
- Compile-time optional
- Runtime optional

Required dependencies are always imported, compile-time optional
dependencies
are loaded if gnome-shell is compiled with support for them, and for
runtime optional dependencies we catch any errors when attempting to
load them.
If runtime optional dependencies fail to load we log a debug-level
message.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agolayout: Add catch when asynchronously setting up the startup animation
Evan Welsh [Thu, 6 Jul 2023 01:12:39 +0000 (18:12 -0700)]
layout: Add catch when asynchronously setting up the startup animation

This ensures any errors that occur in this stage of startup are clearly
logged.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoscripting: Convert to ES module and migrate tests
Evan Welsh [Thu, 6 Jul 2023 01:08:09 +0000 (18:08 -0700)]
scripting: Convert to ES module and migrate tests

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoenvironment: Port environment.js to be an ES module
Evan Welsh [Mon, 10 Jul 2023 06:05:14 +0000 (23:05 -0700)]
environment: Port environment.js to be an ES module

Removes the init() function in favor of executing all environment
changes when the file is imported.

Additionally ports all unit tests using imports.gi.environment.init() to
use the updated module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests: Load unit tests as modules
Evan Welsh [Mon, 10 Jul 2023 05:19:40 +0000 (22:19 -0700)]
tests: Load unit tests as modules

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoci: Include tests/ for linting
Florian Müllner [Thu, 13 Jul 2023 20:02:35 +0000 (22:02 +0200)]
ci: Include tests/ for linting

Linting isn't exclusively about coding style, but can detect
actual bugs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests/unit: Fix remaining ESLint errors
Evan Welsh [Mon, 10 Jul 2023 05:59:46 +0000 (22:59 -0700)]
tests/unit: Fix remaining ESLint errors

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests/shell: Fix remaining ESlint errors
Florian Müllner [Thu, 13 Jul 2023 19:29:13 +0000 (21:29 +0200)]
tests/shell: Fix remaining ESlint errors

All tests are currently excluded from linting, so errors can sneak
in more easily.

We should change that, so quickly fix up any remaining errors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoinsertSorted: Refactor comparator functions to be arrow functions
Evan Welsh [Mon, 10 Jul 2023 05:58:22 +0000 (22:58 -0700)]
insertSorted: Refactor comparator functions to be arrow functions

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests: Move assertArrayEquals to shared assertions file
Evan Welsh [Mon, 10 Jul 2023 05:56:26 +0000 (22:56 -0700)]
tests: Move assertArrayEquals to shared assertions file

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests: Use gjs_context_eval_file to evaluate test scripts
Evan Welsh [Mon, 10 Jul 2023 05:24:48 +0000 (22:24 -0700)]
tests: Use gjs_context_eval_file to evaluate test scripts

GJS provides utilities to run scripts given a filename, using those
utilities we can remove most of the logic implementing file loading.

Additionally the REPL logic does not make much sense for a test
runner and is unused, so remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agodependencies: Specify versions of Shell/St
Florian Müllner [Thu, 13 Jul 2023 22:23:26 +0000 (00:23 +0200)]
dependencies: Specify versions of Shell/St

We started to version them last cycle, so docs can be differentiated
between versions. It is not *expected* that two versions show up
on the same system, but then it also doesn't hurt handling it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoenvironment: Split dependencies loading into a new file
Evan Welsh [Mon, 10 Jul 2023 06:21:23 +0000 (23:21 -0700)]
environment: Split dependencies loading into a new file

Once environment.js is an ES module we need to ensure we can dynamically
specify the version for required GI dependencies such as Clutter.

Moving dependency version setup to dependencies.js ensures gi.require
calls are done before environment.js imports any utilities.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoanimationUtils: Group together various animation helpers
Evan Welsh [Mon, 10 Jul 2023 04:58:21 +0000 (21:58 -0700)]
animationUtils: Group together various animation helpers

The environment module is used to initialize the environment, yet it
currently also defines the adjustAnimationTime() function.

Ideally it should not export any utility functions, in particular
once converted to ESM.

The function cannot be moved to the existing Utils module, as that
depends on an initialized environment, and can therefore not be
imported from environment.js, so use that opportunity to group
together several animation helpers in a new animationUtils module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoci: Bump mutter image
Florian Müllner [Sat, 15 Jul 2023 01:27:22 +0000 (03:27 +0200)]
ci: Bump mutter image

Eieiei, mutter now depends on libei.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2846>

3 years agolookingGlass: Evaluate command asynchronously
Florian Müllner [Wed, 12 Jul 2023 19:40:05 +0000 (21:40 +0200)]
lookingGlass: Evaluate command asynchronously

This allows using await in the command (or the header we
add to it), for example when handling Promises or importing
a module dynamically.

The latter will be crucial when porting to ESM.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agolookingGlass: Reformat command header
Florian Müllner [Wed, 12 Jul 2023 19:32:56 +0000 (21:32 +0200)]
lookingGlass: Reformat command header

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agojsParse: Make getCompletions() asynchronous
Florian Müllner [Wed, 12 Jul 2023 23:52:06 +0000 (01:52 +0200)]
jsParse: Make getCompletions() asynchronous

Part of the possible completions involves evaluating the part
of the passed in text that looks like an object, so that we
can query it for properties.

Using a Function or eval() for that means that we can only
complete text that does not use `await`. To get over that
limitation, evaluate the text in an AsyncFunction instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agojsParse: Replace eval()
Florian Müllner [Wed, 12 Jul 2023 23:52:06 +0000 (01:52 +0200)]
jsParse: Replace eval()

The evil() function is considered eval, replace it like we
already did in looking glass.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agojsParse: Use JSDoc to document functions
Evan Welsh [Mon, 10 Jul 2023 09:25:01 +0000 (02:25 -0700)]
jsParse: Use JSDoc to document functions

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agolookingGlass: Handle completions asynchronously
Florian Müllner [Wed, 12 Jul 2023 23:52:06 +0000 (01:52 +0200)]
lookingGlass: Handle completions asynchronously

They will actually become asynchronous in a following commit,
prepare for that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agolookingGlass: Handle unprintable object
Florian Müllner [Wed, 12 Jul 2023 22:25:43 +0000 (00:25 +0200)]
lookingGlass: Handle unprintable object

We currently throw an error when encountering a result that cannot
be represented as string, with the prompt appearing somewhat stuck
(the input cannot be committed).

Showing a lame fallback instead at least avoids that issue. When
the object has a typeof 'object' but is not an instanceof Object,
we are likely dealing with an ES module, and can show a slightly
less lame fallback.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>